package edu.tgc.entity.file;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.MappedSuperclass;

import edu.tgc.entity.system.AbstractAuditableEntity;

@MappedSuperclass
public abstract class AbstractFileResource<U, ID extends Serializable> extends AbstractAuditableEntity<U, ID> {

    private static final long serialVersionUID = -1219526157913798357L;
    protected String contentType;
    protected String ext;
    protected String name;
    protected String originalFilename;
    protected FilePath path;
    protected Long size;

    public AbstractFileResource() {
    }

    public AbstractFileResource(ID id) {
        this.id = id;
    }

    @Column(length = 63)
    public String getContentType() {
        return this.contentType;
    }

    @Column(length = 15)
    public String getExt() {
        return this.ext;
    }

    @Column(length = 255)
    public String getName() {
        return this.name;
    }

    @Column(length = 255)
    public String getOriginalFilename() {
        return this.originalFilename;
    }

    @Embedded
    public FilePath getPath() {
        return this.path;
    }

    public Long getSize() {
        return this.size;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setOriginalFilename(String originalFilename) {
        this.originalFilename = originalFilename;
    }

    public void setPath(FilePath path) {
        this.path = path;
    }

    public void setSize(Long size) {
        this.size = size;
    }

}
